package com.techsoul.module.accounting.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.common.core.pojo.vo.UserVo;
import com.techsoul.module.accounting.pojo.param.*;
import com.techsoul.module.accounting.pojo.vo.AccountingArVo;
import com.techsoul.module.order.pojo.vo.SalesOrderItemVo;

import java.util.List;
import java.util.Map;

/**
 * 财务应收 Service接口
 * 
 * @author liuen
 * @date 2021-04-11
 */
public interface IAccountingArService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(AccountingArSaveParam params);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(AccountingArSaveParam params);

    /**
     * 详情
     * @param id
     * @return
     */
    AccountingArVo findById(String id);

    /**
     * 列表
     * @param params
     * @return
     */
    List<AccountingArVo> findAll(AccountingArSearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<AccountingArVo> findAll(AccountingArSearchParam params, Integer current, Integer pageSize);
    /**
     * 获得供应商付款金额
     * @param map
     * @param userVo
     * @return
     */
    Double getCustomerArAmount(Map map, UserVo userVo);


    /**
     * 产生财务结算数据
     * @param salesOrderItem
     * @param  materialBuyPriceSearchParam
     * @return
     */
    Double getSaleTotalAmount(SalesOrderItemVo salesOrderItem, MaterialSalesPriceSearchParam materialBuyPriceSearchParam);

    /**
     * 产生搞活动财务结算数据
     * @param salesOrderItem
     * @param  promotionDiscountPriceSearchParam
     * @return
     */
    Double getSaleTotalDisctAmount(SalesOrderItemVo salesOrderItem, PromotionDiscountPriceSearchParam promotionDiscountPriceSearchParam, MaterialSalesPriceSearchParam materialSalesPriceSearchParam);

    /**
     * 供应商对账减
     *
     * @param  accountingArSaveParam
     * @return
     */
    String handleAdjustSub(AccountingArSaveParam accountingArSaveParam);
    /**
     * 供应商对账减
     *
     * @param  accountingArSaveParam
     * @return
     */
    String handleAdjustAdd(AccountingArSaveParam accountingArSaveParam);
    double convertMileToCash(Double StoreDiscountAmt);
    /**
     * 生成财务应收数据
     * @param apamt
     * @param salesOrderItem
     * @return
     */
    String generateArList(Double apamt,SalesOrderItemVo salesOrderItem,UserVo userVo);
}
